#ifndef TABLEINFO_H
#define TABLEINFO_H

#include "abstractcontainer.h"

class QString;
class QSqlDatabase;


class TableInfo
{
public:
    TableInfo(const QString &tableName, const QSqlDatabase &db);
    TableInfo(AbstractContainer *columns);

    bool isValid() { return m_valid; }

    int columnsCount() { return m_columns.size(); }
    QString columnName(int col);
    QString columnType(int col);

    bool isEqual(AbstractContainer *columns);

private:
    void getInfoFromSqlite3(const QString &tableName, const QSqlDatabase &db);
    bool parseColumnsFromSql(const QString &columns);

    bool m_valid;
    AbstractContainer m_columns;
};

#endif // TABLEINFO_H
